package com.ts.api.module.product.entity.qo;

import com.gitee.apanlh.util.base.CollUtils;
import com.ts.api.module.product.entity.po.ProductPlanPO;
import lombok.Data;

import java.util.List;

/**
 *  API机构计划查询对象
 */
@Data
public class ProductPlanFieldQO {

    /** 机构计划ids */
    private List<Long> listProductPlanId;

    public ProductPlanFieldQO() {
        super();
    }

    public ProductPlanFieldQO(List<ProductPlanPO> list) {
        this.listProductPlanId = CollUtils.toList(list, t -> t.getId());
    }

    /**
     * 构建
     *
     * @param  list 机构计划
     * @return ProductPlanFieldQO
     */
    public static ProductPlanFieldQO create(List<ProductPlanPO> list) {
        return new ProductPlanFieldQO(list);
    }

}
